package com.xinzhi.savingpot.userinfo.controller;

import com.xinzhi.savingpot.userinfo.service.impl.MoneyImpl;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/Money")
@Api("余额显示")
public class MoneyController {
    @Autowired
    private MoneyImpl money;
    @GetMapping("/check")
    @ApiOperation("查余额")
    public String check(@RequestParam("userNum") String userNum){
        int user = Integer.valueOf(userNum);
        return money.money(user);
    }
    @GetMapping("/up")
    @ApiOperation("跟新余额")
    public String update(){
        return money.updateMoney();
    }

}
